home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!bjg
- From: Brad Grossman <bjg@primenet.com>
- Newsgroups: comp.lang.c++
- Subject: Re: How can I include IOSTREAM.H only once?
- Date: 27 Feb 1996 02:25:01 -0700
- Organization: Primenet (602)395-1010
- Sender: root@primenet.com
- Message-ID: <4guild$r2i@nnrp1.news.primenet.com>
- References: <4gre90$oei@service.polymtl.ca>
- X-Posted-By: bjg@usr5.primenet.com
-
- Michael Gaudette <bluefox@info.polymtl.ca> wrote:
- : I am presently engaged in what is usually called "the learning process",
- : and I've been programming simple programs with classes. Because of this,
- : I have had to #include <iostream.h> in most of my "class.cpp" files AND
- : in my main program. This (added to conio.h and all the other standard
- : libraries) usually result in a simple program being 20000 lines long.
- : Is there any way (using Borland v4.5) to make the compiler only link
- : those files ONCE?
-
- : Thanks in advance for any help I may receive
-
- I'm not all that experienced at C++ programming, but when looking through
- the container classes that come with C++, I see the solution to your
- problem. Try this where you need IOSTREAM.H:
-
- #if !defined ( __IOSTREAM_H )
- #include <iostream.h>
- #endif
-
-
- --
- Brad Grossman "Energy derives from both the plus and negative"
- Metallica, Eye of the Beholder
-